package com.one.consumer.user.presenter;

import android.content.Context;

import com.one.common.model.http.callback.ObserverOnResultListener;
import com.one.common.presenter.BaseApiPresenter;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.base.IListView;
import com.one.consumer.order.model.OrderModel;
import com.one.consumer.user.model.item.InvoiceItem;

import java.util.ArrayList;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/10/28 5:23 PM
 * description ：发票列表 开票列表
 **/
public class InvoiceListPresenter extends BaseApiPresenter<IListView, OrderModel> {
    public InvoiceListPresenter(IListView mView, Context mContext) {
        super(mView, mContext, new OrderModel((BaseActivity) mContext));
    }


    /**
     * 获取发票列表
     */
    public void getInvoiceList(){
        mModel.invoiceList(mView.getPage() + "", new ObserverOnResultListener<ArrayList<InvoiceItem>>() {
            @Override
            public void onResult(ArrayList<InvoiceItem> addressItems) {
                if(mView!=null){
                    mView.loadSuccess(addressItems);
                }
            }
        });
    }
}
